<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //1.字符串拼接的方式
        let star = '';//声明一个空变量
        for (let i = 0; i < 5; i++) {
            star = star + "*";
        }
        console.log(star);//一行打印5个*

        //打印四行，每行5个小行星
        for (let i = 0; i < 4; i++) {//最外面的是几行
            let star = '';
            for (let j = 0; j < 5; j++) {//内部是几个星
                star = star + "*";
            }
            console.log(star);

        }
    </script>
</body>

</html>